package com.code.user.model.po;

import com.code.commons.model.po.BasePO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * 用户余额信息PO及持久层对象
 *
 * @author tangyifei
 * @since 2019年12月27日18:32:08
 */
@ApiModel("用户余额信息PO及持久层对象")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class UserCoinBalance extends BasePO<Long> {

    private static final long serialVersionUID = -9000807617605981611L;

    @ApiModelProperty(value = "主键", example = "1")
    @Id
    @GeneratedValue(generator = "JDBC")
    private Long id;

    @ApiModelProperty(value = "用户主键", example = "1")
    @NotBlank(message = "用户主键不能为空")
    @Length(min = 1, max = 64)
    private String userId;

    @ApiModelProperty(value = "币种类型", example = "1")
    @NotBlank(message = "币种类型不能为空")
    private String coinType;

    @ApiModelProperty(value = "币种余额（充值金额）", example = "1")
    @NotNull(message = "币种余额（充值金额）不能为空")
    private BigDecimal coinBalance;

    @ApiModelProperty(value = "币种地址", example = "1")
    @NotBlank(message = "币种地址不能为空")
    private String coinAddress;

    @ApiModelProperty(value = "版本号", example = "1")
    @NotNull(message = "版本号不能为空")
    private Integer version;

    @ApiModelProperty(value = "已经同步的充值记录列表", example = "1")
    private List<RechargeTranRecord> rechargeTranRecordList;

    @ApiModelProperty(value = "提币订单主键", example = "1")
    private String withdrawOrderId;

}
